<template>
	<view class="container">
		<view class="title">
			<text>{{title}}</text>
		</view>
		<view class="pic-box">
			<view class="pic b-b">
				<image :src="imgsrc" mode="aspectFit" class="image" @tap="previewImage"></image>
			</view>
		</view>
		<view v-if="type==1" class="note">
			<text>注：根据国家工商总局《网络交易管理办法》要求对入驻商家营业执照信息进行公示。</text>
			<text class="fontB">以上营业资质信息均由商家提供，信息以证件照所示为准。</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgsrc:'',
				title:'',
				type:0,
			};
		},
		onLoad(option){
			this.imgsrc = option.imgsrc;
			console.log(this.imgsrc);
			this.type = option.type;
			if(this.type == 1)
				this.title = '营业执照';
			else if(this.type == 2)
				this.title = '手持身份证认证';
		},
		methods:{
			previewImage: function(e) {
				var current = e.target.dataset.src
				let urls = [];
				urls.push(this.imgsrc);
				uni.previewImage({
					current: current,
					urls: urls
				})
			},
		}
	}
</script>

<style lang='scss'>
	page{
		background: $page-color-base;
	}
	.container{
		padding: 20upx 25upx;
	}
	.title{
		align-items: center;
		justify-content: center;
		display: flex;
		font-size: $font-base;
	}
	.pic-box{
		padding: 20upx 0;
		align-items: center;
		justify-content: center;
		display: flex;
	}
	.note{
		font-size: $font-base;
		.fontB{
			font-weight: 700;
		}
	}
</style>
